//
//  GCChaZhaoTagTableViewCell.m
//  GoldChampion
//
//  Created by Mac on 2018/4/12.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "GCChaoZhaoFunTableViewCell.h"

@interface  GCChaoZhaoFunTableViewCell()
@property(nonatomic, strong) STButton                     *iconButton;
@property(nonatomic, strong) STLabel                     *nameLable;
@property(nonatomic, strong) STLabel                     *desLable;

@property(nonatomic, strong) UIImageView                     *imageView1;
@property(nonatomic, strong) UIImageView                     *imageView2;
@property(nonatomic, strong) UIImageView                     *imageView3;
@property(nonatomic, strong) UIImageView                     *imageView4;
@property(nonatomic, strong) UIImageView                     *imageView5;

@property(nonatomic, strong) NSArray                     *imageArray;

@end
@implementation GCChaoZhaoFunTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 140;
}
#pragma mark --subView
- (void)configSubView{
    self.iconButton = [[STButton alloc] initWithFrame:CGRectMake(15, 10, 36, 36)
                                                title:nil
                                           titleColor:nil
                                            titleFont:0
                                         cornerRadius:18
                                      backgroundColor:nil
                                      backgroundImage:nil
                                                image:[UIImage imageNamed:@"yanjing"]];
    [self addSubview:self.iconButton];
    
    self.nameLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right  +15, self.iconButton.top, 200, 20)
                                               text:@"单件啊来"
                                          textColor:SecendTextColor
                                               font:16
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.nameLable];
    
    
    self.desLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right  +15, self.nameLable.bottom  + 5, UIScreenWidth- 30 - self.iconButton.right, 20)
                                              text:@"可能认识的人:大佬"
                                         textColor:ThirdTextColor
                                              font:14
                                       isSizetoFit:NO
                                     textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.desLable];
    
    self.attentionButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, 65, 25)
                                                     title:@"+ 关注"
                                                titleColor:[UIColor whiteColor]
                                                 titleFont:14
                                              cornerRadius:4
                                           backgroundColor:TM_redColor
                                           backgroundImage:nil
                                                     image:nil];
    self.attentionButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    self.attentionButton.right = UIScreenWidth - 15;
    self.attentionButton.centerY = self.iconButton.centerY;
    [self addSubview:self.attentionButton];
    
    CGFloat imageViewWith = (self.desLable.width - 8)/5;
    
    NSArray * imageArray = @[@"更换",@"bibngshan",@"CHANGJIANG",@"reba1",@"RENWU"];
    
    self.imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(self.desLable.left, self.desLable.bottom + 10, imageViewWith, imageViewWith)];
    self.imageView1.image = [UIImage imageNamed:@"更换"];
    [self addSubview:self.imageView1];
    
    
    self.imageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(self.imageView1.right + 2, self.desLable.bottom + 10, imageViewWith, imageViewWith)];
    self.imageView2.image = [UIImage imageNamed:@"bibngshan"];
    [self addSubview:self.imageView2];
    
    
    self.imageView3 = [[UIImageView alloc] initWithFrame:CGRectMake(self.imageView2.right + 2, self.desLable.bottom + 10, imageViewWith, imageViewWith)];
    self.imageView3.image = [UIImage imageNamed:@"CHANGJIANG"];
    [self addSubview:self.imageView3];
    
    
    self.imageView4 = [[UIImageView alloc] initWithFrame:CGRectMake(self.imageView3.right + 2, self.desLable.bottom + 10, imageViewWith, imageViewWith)];
    self.imageView4.image = [UIImage imageNamed:@"reba1"];
    [self addSubview:self.imageView4];
    
    self.imageView5 = [[UIImageView alloc] initWithFrame:CGRectMake(self.imageView4.right + 2, self.desLable.bottom + 10, imageViewWith, imageViewWith)];
    self.imageView5.image = [UIImage imageNamed:@"RENWU"];
    [self addSubview:self.imageView5];
    
    self.imageArray = @[self.imageView1,self.imageView2,self.imageView3,self.imageView4,self.imageView5];
}
- (void)debugRandromImage{
    NSInteger imageCount = arc4random()%5;
    for (NSInteger i = 0; i< self.imageArray.count; i ++) {
        UIImageView * imageView = self.imageArray[i];
        if (i <= imageCount) {
            imageView.hidden = NO;
        }else{
            imageView.hidden = YES;
        }
    }
}
@end

